'''
str = ['张三','李四','王五','赵六','田七']


with open('students.txt', mode='w', encoding='utf-8') as f:
    for s in str:
        f.write(s + "\n")
    

# 打开文件并读取学生姓名
with open("students.txt", "r",encoding='utf-8') as file:
    print( file.readlines())


with open("students.txt", "r") as f:
    s = f.read()

with open("students_copy.txt" , "w") as file:
    file.write(s)


'''       


import os, shutil

dir_name = 'projects'
old_name = 'students_copy.txt'
new_name = 'copy.txt'

os.makedirs(dir_name)
os.rename(old_name,new_name)

if os.path.isfile('copy.txt'):
    shutil.move('copy.txt','projects')
os.listdir('projects')

























